﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace QuangNgai.nhaplieu
{
    public partial class frmNhapHoSoLKTD : DevExpress.XtraEditors.XtraForm
    {
        private frmNhapHoSo frmParent;

        public frmNhapHoSo FrmParent
        {
            get { return frmParent; }
            set { frmParent = value; }
        }
        public frmNhapHoSoLKTD()
        {
            InitializeComponent();
        }
        public frmNhapHoSoLKTD(frmNhapHoSo fParent)
        {
            InitializeComponent();
            FrmParent = fParent;
        }

        private void frmNhapHoSoLKTD_Load(object sender, EventArgs e)
        {
            this.dictionaryTableAdapter.Fill(this.lTQNDataSet.Dictionary);

        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            var currChiTiet = FrmParent.GvChiTiet.Tag as LTQNDataSet.HoSoDetailRow;
            currChiTiet.AttributeValue = ((dictionaryBindingSource.Current as DataRowView).Row as LTQNDataSet.DictionaryRow).IndexName;
            //FrmParent.BtnThemHS.Focus();
            //FrmParent.GcHoSo.Focus();
            
            FrmParent.gvChiTiet_KeyUp(null, new KeyEventArgs(Keys.Enter));
            this.Dispose();
        }
    }
}